/*
 * Copyright © 2024-2025 Wenze Wei
 *
 * This file is part of StadionOS.
 *
 * This Source Code Form is subject to the terms of the GNU General Public License, v. 2.0.
 * You can obtain a copy of the GPL at
 * https://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 */

#ifndef STADIONOS_SAPI_H
#define STADIONOS_SAPI_H

typedef struct {
    void (*create_window)(int width, int height);
    void (*move_window)(int x, int y);
    void (*set_window_title)(const char *title);
    
    void (*register_key_handler)(void (*handler)(int keycode, int modifiers));
    void (*register_pointer_handler)(void (*handler)(int x, int y, int button));

    void (*begin_frame)();
    void (*end_frame)();

    void (*get_display_resolution)(int *width, int *height);
    
    void (*draw_rounded_rect)(int x, int y, int width, int height, int radius);
    void (*draw_text)(int x, int y, const char* text);
    
    void (*set_compositor_implementation)(void *impl);
} SAPI;

void sapi_init(SAPI *api);

#endif // STADIONOS_SAPI_H